#include <vector>
#include <iostream>

using namespace std;
bool isValidSubsequence(vector<int> array, vector<int> subsequence) {
  int l = 0;
  int sl = 0;
  while(l < array.size() && sl < subsequence.size()) {
    if (array[l] == subsequence[sl]) {
      sl++;
    }
    l++;
  }
  return sl == subsequence.size();
}

int main(int argc, char const *argv[]) {
  cout << isValidSubsequence({2,1,3,5}, {1,5});
  return 0;
}
